package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFillInsert;
import com.sky.annotation.AutoFillUpdate;
import com.sky.entity.Setmeal;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface SetmealMapper {
    @Select("select count(*) from setmeal where category_id=#{id}")
    Long seleceByCategoryId(Long id);

    @AutoFillInsert
    void insert(Setmeal setmeal);

    Integer selectCountByName(String name);

    Page<Setmeal> selectQueryPage(Setmeal setmeal);


    @Update("update setmeal set status=#{status} where id=#{id}")
    void updateStatusById(Integer status, Long id);

    Integer selectStatusCountByIds(List<String> ids, Integer status);

    void deleteByIds(List<String> ids);


    Setmeal selectById(Long id);

    Integer selectCountByNameNotId(String name,Long id);

    @AutoFillUpdate
    void updateById(Setmeal setmeal);
}
